<?php
/**
 * Created by PhpStorm.
 * User: user
 * Date: 2018/6/18
 * Time: 12:29
 */

namespace app\index\model;
use think\Model;

class News extends Model
{
    protected $table='news';

    protected $autoWriteTimestamp = true;
// 定义关联方法
    public function author()
    {
        return $this->belongsTo('User');
    }
    public function whofavors()
    {
        return $this->belongsToMany('User', 'access');
    }
}